home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
toasterpaint
/
iff2clip.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
4KB
|
165 lines
/* IFF2Clip.rexx V2.05 -- Turns a series of IFF's To a Clip */
/* By Bob Caron © 1995 NewTek Inc. */
parse arg InClipName","OutClipName","ignore1","ignore2
if ignore2="" then outclipname=inclipname
if ~show('l','rexxsupport.library') then do
if ~addlib('rexxsupport.library',0,-30,34) then do
call quit("RexxSupport Missing")
end
end
Address "DigiPaint"
options results
if InClipName="" & OutClipName="" then do
'Askb'"This only works;from process clip."
exit
end
'AskfBasename'
if RC = 5 then call quit("Canceled!")
IFFBaseName=Result
'AskuStart IFF Frame #'
if RC = 5 then call quit("Canceled!")
StartFrame=strtoint(Result)
'AskuEnd IFF Frame #'
if RC = 5 then call quit("Canceled!")
Endframe=strtoint(Result)
dots=0
XWin = 100
YWin = 40
Clear = d2c(12)
nv = ''
cr = '0a'x
call getfontsize
wid = width*48
hei = theight+height*10
if ~open('Window','RAW:'XWin'/'YWin'/'wid'/'hei'/IFF2Clip Script V2.05 - CTRL-C to Abort/NOSIZE/SCREEN 'ps,'W') then exit
do i = StartFrame to EndFrame
Filename=IFFBaseName||Overlay(i,'000',4-Length(i))
call OpenWindow(filename,outclipname,i,endframe)
if exists(filename) then do
Call LoadRGB(filename)
'Apfc' /* Append a field */
'Apfc' /* Append a field */
end
end
'Iclp' /* Create the icon */
exit
quit:
parse arg message
'Askb'message
exit
SetFile: PROCEDURE /* Select file in current requester */
arg file
dirname=GetPathName(file)
'Dnam'dirname /* Enter file path */
/* 'Dsel'*/ /* Hit return on directory */
filename=GetFileName(file)
'Fnam'filename /* Enter File name */
'Okls' /* Hit the OK button */
return
SaveRGB: PROCEDURE
arg filename
'Sa24' /* Call file requester */
Call SetFile(filename)
return
LoadRGB: PROCEDURE /* Load Brush */
arg filename
'Lo24' /* Call file requester */
Call SetFile(filename)
return
GetFileName: procedure /* Extract file name from full file specification */
ARG fullfile
c = lastpos("/",fullfile)
if c = 0 then c = lastpos(":",fullfile)
return substr(fullfile, c + 1)
GetPathName: procedure /* Extract directory name from full file specification */
ARG fullfile
c = lastpos("/",fullfile)
if c = 0 then c = lastpos(":",fullfile)
return left(fullfile,c)
OpenWindow:
parse arg framename,outclipname,frame,endframe
pdots="...."
dots=dots+1
if dots>4 then dots=1
call writech('Window',Clear||nv||cr)
call writech('Window','Current Source IFF ['getfilename(Framename)']'cr)
call writech('Window',' Current Dest Clip ['getfilename(OutClipName)']'cr)
call writech('Window',''cr)
call writech('Window','Current Frame: 'Frame''cr)
call writech('Window',' End Frame: 'EndFrame''cr)
call writech('Window',''cr)
call writech('Window','Processing'right(pdots,dots)||cr)
return
getfontsize:
if open('font','env:sys/font.prefs','R') then do
font = readch('font',word(statef('env:sys/font.prefs'),2))
call close('font')
font = substr(font,index(font,'FONT')+4)
font = substr(font,index(font,'FONT')+4)
height = c2d(substr(font,29,2))
tfont = substr(font,index(font,'FONT')+4)
theight = c2d(substr(tfont,29,2))
font = substr(font,33)
font = left(font,index(font,d2c(0))-1-5)
if open('font','FONTS:'font'/'height,'R') then do
width = c2d(right(readch('font',116),2))
call close('font')
end
else if height=9 then width = 10
else width = 8
end
else do
theight = 8
height = 8
width = 8
end
return
strtoint:
arg numb
numb=cleanline(numb)
total=0
do x=1 to length(numb)
total=total+(abs(48-c2d(substr(numb,(length(numb)+1)-x,1)))*(10**(x-1)))
end
return total
cleanline: /* Remove a wudge of non-alpha char's */
parse arg line
line=translate(line,"","/*=:.;:<>+-!@#$%^&*()_|\[]{}?~`,")
line=translate(line,"","abcdefghijklmnopqrstuvwxyz")
line=translate(line,"","ABCDEFGHIJKLMNOPQRSTUVWXUZ")
line=translate(line,"",d2c(34))
line=translate(line,"",d2c(40))
line=translate(line,"",d2c(41))
line=translate(line,"",d2c(0))
line=compress(line)
return line